import fetch from '@/utils/fetch'

export function getDeviceList(areaId, params) {
	return fetch({
	    url: '/device/v1/mgt/device',
	    method: 'get',
		headers: {'x-area-id': areaId},
	    params
  	})
}

export function getDeviceDetail(id) {
	return fetch({
	    url: `/device/v1/mgt/device/${id}`,
	    method: 'get'
  	})
}

export function createDevice(data) {
	return fetch({
		url: '/device/v1/mgt/device',
		method: 'post',
		data
	})
}

export function modifyDevice(id, data) {
	return fetch({
	    url: `/device/v1/mgt/device/${id}`,
	    method: 'patch',
	    data
	})
}

//拉取设备台账详情
export function getDetail(device_id){
	return fetch({
		url:`/device/v1/mgt/device/${device_id}`,
		method:"get"
	})
}

export const devTypeList = {
	1: '环境监控设备(供配电)',
	2: '变压器',
	3: '发电机',
	4: '提排泵',
	5: '消防主机',
	6: "排水泵(变频泵)",
	7: "生活水泵(变频泵)",
	8: "消防泵(喷淋消火栓泵)",
	9: "喷淋泵",
	10: '室内消防泵',
	11: '室外消防泵',
	12: "稳压泵",
	13: "环境监控设备(给排水)",
	14: "环境监控设备(消防)",
	15: "远传水表",
	16: "暖通",
	17: "供回水温度",
	18: "管压",
	19: "货梯",
	20: "客梯",
	21: "进线柜",
	22: "冷却塔",
	23: "锅炉",
	24: "循环泵",
	25: "消防蓄水池",
	26: "油箱",
	27: "水箱",
	28: "蓄电池组",
	29: "远传电表",
	30: "环境监控设备(生活水泵)"
}
